import Vue from 'vue'
import Router from 'vue-router'
import Register from "../components/Register";
import homePage from "../views/homePage";
import productFunction from "../views/productFunction";
import mechanism from "../views/mechanism";
import localized from "../views/localized";
import vipPower from "../views/vipPower";
import cooperation from "../views/cooperation";
import helpCenter from "../views/helpCenter";
import NavMenu from "../views/NavMenu";
import Login from "../components/Login";
import mainPage from "../components/mainPage";
import Settings from "../components/Settings";
import classDetail from "../components/classDetail";
import CourseMessage from "../components/CourseMessage";
import GradesManagement from "../components/GradesManagement";
import SingleStudentAnalysis from "../components/SingleStudentAnalysis";
import CourseContent from "../components/CourseContent";
import taskManagement from "../components/taskManagement";
import homework from "../components/homework";
import RichText from "../components/RichText";
import onlineTest from "../components/onlineTest";

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'menu',
      component: NavMenu,
      redirect:'/homePage',
      children:[
        {
        path: '/homePage',
        name: 'homePage',
        component: homePage
      },
        {
          path: '/productFunction',
          name: 'productFunction',
          component: productFunction
        },
        {
          path: '/mechanism',
          name: 'mechanism',
          component: mechanism
        },
        {
          path: '/localized',
          name: 'localized',
          component: localized
        },
        {
          path: '/cooperation',
          name: 'cooperation',
          component: cooperation
        },
        {
          path: '/vipPower',
          name: 'vipPower',
          component: vipPower
        },
        {
          path: '/helpCenter',
          name: 'helpCenter',
          component: helpCenter
        },
      ]
    },
    {
      path: '/register',
      name: 'register',
      component: Register
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/mainPage',
      name: 'mainPage',
      component: mainPage
    },
    {
      path: '/settings',
      name: 'settings',
      component: Settings
    },
    {
      path: '/classDetail',
      name: 'classDetail',
      component: classDetail,
      children:[
        {
          path: '/courseMessage',
          name: 'courseMessage',
          component: CourseMessage
        },
        {
          path: '/gradesManagement',
          name: 'gradesManagement',
          component: GradesManagement
        },
        {
          path: '/singleStudentAnalysis',
          name: 'singleStudentAnalysis',
          component: SingleStudentAnalysis
        },
        {
          path: '/courseContent',
          name: 'courseContent',
          component: CourseContent
        },
      ]
    },
    {
      path: '/taskManagement',
      name: 'taskManagement',
      component: taskManagement
    },
    {
      path: '/homework',
      name: 'homework',
      component: homework
    },
    {
      path: '/RichText',
      name: '/RichText',
      component: RichText
    },
    {
      path: '/onlineTest',
      name: '/onlineTest',
      component: onlineTest
    }
  ],
  mode: 'history' //使URL不带#
})
